#ifndef __HMC5883_H_
#define __HMC5883_H_

#include "main.h"
#include "stdlib.h"	



#define SCL_PORT		GPIOA
#define SCL_PIN			GPIO_Pin_5
#define SDA_PORT		GPIOA
#define SDA_PIN			GPIO_Pin_7

struct Qmc5883Data
{
	short x;
	short y;
	short z;
	float roll;
	float pitch;
	float yaw;
	unsigned char status;
	float temp;

	short xMax;
	short xMin;
	short yMax;
	short yMin;
	short zMax;
	short zMin;

	short xOffest;
	short yOffest;
	short xK;
	short yK;

};

extern struct Qmc5883Data qmcData;
extern unsigned char qmcBuffer[10];



void Qmc5883_Init(void);
unsigned char Qmc5883_GetData(void);
void Qmc5883_Translate(struct Qmc5883Data *qmcData, unsigned char *qmcBuffer);
void Qmc883_Calib(void);
#endif
